<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    function wrap() {
        var test = "test";
        function inner() {
            console.log(test)
        }
        inner()
    }
    wrap()
</script>
</html>